package com.ruoyi.web.service;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.web.mapper.DemoCustomerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.web.domain.DemoCustomer;

/**
 * 顾客Service业务层处理
 *
 * @author pei
 * @date 2024-06-02
 */
@Service
public class DemoCustomerService
{
    @Autowired
    private DemoCustomerMapper demoCustomerMapper;

    /**
     * 查询顾客
     *
     * @param cId 顾客主键
     * @return 顾客
     */

    public DemoCustomer selectDemoCustomerByCId(Long cId)
    {
        return demoCustomerMapper.selectDemoCustomerByCId(cId);
    }

    /**
     * 查询顾客列表
     *
     * @param demoCustomer 顾客
     * @return 顾客
     */

    public List<DemoCustomer> selectDemoCustomerList(DemoCustomer demoCustomer)
    {
        return demoCustomerMapper.selectDemoCustomerList(demoCustomer);
    }

    /**
     * 新增顾客
     *
     * @param demoCustomer 顾客
     * @return 结果
     */

    public int insertDemoCustomer(DemoCustomer demoCustomer)
    {
        demoCustomer.setCreateTime(DateUtils.getNowDate());
        return demoCustomerMapper.insertDemoCustomer(demoCustomer);
    }

    /**
     * 修改顾客
     *
     * @param demoCustomer 顾客
     * @return 结果
     */

    public int updateDemoCustomer(DemoCustomer demoCustomer)
    {
        demoCustomer.setUpdateTime(DateUtils.getNowDate());
        return demoCustomerMapper.updateDemoCustomer(demoCustomer);
    }

    /**
     * 批量删除顾客
     *
     * @param cIds 需要删除的顾客主键
     * @return 结果
     */

    public int deleteDemoCustomerByCIds(Long[] cIds)
    {
        return demoCustomerMapper.deleteDemoCustomerByCIds(cIds);
    }

    /**
     * 删除顾客信息
     *
     * @param cId 顾客主键
     * @return 结果
     */

    public int deleteDemoCustomerByCId(Long cId)
    {
        return demoCustomerMapper.deleteDemoCustomerByCId(cId);
    }
}
